middleware.use(async function (input) {
    // 获取user
    let user = layui.data('user')
    // 不在登录也时
    if (input.new_route?.name != 'login') {
        // 验证user
        if (Object.entries(user).length == 0) {
            window.location.href = "#/login"
        } else if (typeof user['token'] === "undefined") {
            window.location.href = "#/login"
        }
    }
    return true
})